import request from '@/utils/http'
import { BaseResult, PaginationResult } from '@/types/axios'

export class AdminService {
  // 添加管理员
  static addAdmin(data: any) {
    return request.post<BaseResult<PaginationResult<any>>>({
      url: '/add_admin',
      data
    })
  }
  // 管理员列表
  static getListAmin(params: any) {
    return request.get<BaseResult<PaginationResult<any>>>({
      url: '/list_admin',
      params
    })
  }
  // 删除管理员
  static delAdmin(id: number | string) {
    return request.post<BaseResult<PaginationResult<any>>>({
      url: '/del_admin',
      data: { id }
    })
  }
  // 修改管理员
  static updateAdmin(data: any) {
    return request.post<BaseResult>({
      url: '/update_pw',
      data
    })
  }
}
